/* Anhui Wanyun Information Technology Co., Ltd. */
package com.liliudong.pinkyponk.biz.sys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.liliudong.pinkyponk.biz.base.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * 系统部门结构
 *
 * @author Liudong.li
 * @version 1.0
 * @date 2021-10-14 21:16
 */
@Data
@TableName
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SysOrg extends BaseEntity implements Serializable {

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 部门唯一标识码
     */
    private String orgNo;

    /**
     * 部门名称
     */
    private String orgName;

    /**
     * 父部门
     */
    private String parentOrgNo;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        SysOrg sysOrg = (SysOrg) o;
        return Objects.equals(id, sysOrg.id) && Objects.equals(orgNo, sysOrg.orgNo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), orgNo);
    }
}
